package edu.chl.tda367.mynotes.util;

import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import javax.swing.undo.UndoManager;

import edu.chl.tda367.mynotes.core.MyNotes;

/*
 * The undo listener. Adds the edits made in the JTextPane to the UndoManager.
 */

public class MyUndoeableEditListener
          implements UndoableEditListener {

	private UndoManager undo = MyNotes.getInstance().getUndoManager();

    public void undoableEditHappened(UndoableEditEvent e) {
        //Remember the edit and update the menus
    	undo.addEdit(e.getEdit());
    }
}
